#!/bin/sh
##########################################################################
# This file is part of Hawkengine.
#
# Hawkengine is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Hawkengine is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Hawkengine.  If not, see <http://www.gnu.org/licenses/>.
##########################################################################

GENERATED_FILE="# Auto-Generated -- DO NOT EDIT"

# .pro file
PRO=$QT_PROJECT_DIR/$QT_TARGET.pro
echo "$GENERATED_FILE" > $PRO
echo "QT += $QT_MODULES" >> $PRO
echo "TARGET = $QT_TARGET" >> $PRO
echo "TEMPLATE = app" >> $PRO
echo "CONFIG += debug" >> $PRO
echo "VERSION = $QT_VERSION" >> $PRO
echo "SOURCES = $QT_SOURCES" >> $PRO
echo "DESTDIR = $QT_BIN_DIR" >> $PRO
echo "INCLUDEPATH = $QT_INCLUDEPATH" >> $PRO
echo "DEFINES += $QT_DEFINES" >> $PRO
echo "OBJECTS_DIR = $QT_TEMPDIR" >> $PRO
echo "" >> $PRO
echo "message(PlatformCheck)" >> $PRO
echo "macx {" >> $PRO
echo "  message(Mac)" >> $PRO
echo "  ICON = $QT_MAC_ICON" >> $PRO
echo "  TARGET = $QT_TARGET_DISPLAY" >> $PRO
echo "}" >> $PRO
echo "win32 {" >> $PRO
echo "  message(Windows)" >> $PRO
echo "  RC_FILE = $QT_TARGET_BASE.rc" >> $PRO
echo "}" >> $PRO
echo "linux-g++|unix {" >> $PRO
echo "  message(Nix)" >> $PRO
echo "  SHARE_DIR=/usr/share" >> $PRO
echo "  desktop.path = \$\${SHARE_DIR}/applications" >> $PRO
echo "  desktop.files += $QT_TARGET.desktop" >> $PRO
echo "  icon26.path = \$\${SHARE_DIR}/icons/hicolor/26x26/apps" >> $PRO
echo "  icon26.files += maemo/${QT_TARGET}_26.png" >> $PRO
echo "  icon48.path = \$\${SHARE_DIR}/icons/hicolor/48x48/apps" >> $PRO
echo "  icon48.files += maemo/${QT_TARGET}_48.png" >> $PRO
echo "  icon64.path = \$\${SHARE_DIR}/icons/hicolor/64x64/apps" >> $PRO
echo "  icon64.files += maemo/${QT_TARGET}_64.png" >> $PRO
echo "  icon80.path = \$\${SHARE_DIR}/icons/hicolor/80x80/apps" >> $PRO
echo "  icon80.files += maemo/${QT_TARGET}_80.png" >> $PRO
echo "  linux-g++-maemo|maemo5|symbian {" >> $PRO
echo "    message(Nix|Mobile)" >> $PRO
echo "    DEFINES += MOBILE OPENGL_ES QT_OPENGL_ES_1" >> $PRO
echo "    LIBS += -lGLES_CM" >> $PRO
echo "  }" >> $PRO
echo "  linux-g++-maemo {" >> $PRO
echo "    target.path = /opt/$QT_TARGET/bin" >> $PRO
echo "  } else:maemo5 { " >> $PRO
echo "    target.path = /opt/usr/bin" >> $PRO
echo "  } else {" >> $PRO
echo "    target.path = /usr/bin" >> $PRO
echo "  }" >> $PRO
echo "  INSTALLS += target desktop icon26 icon48 icon64 icon80" >> $PRO
echo "}" >> $PRO
echo "" >> $PRO

# .desktop file
DESKTOP=$QT_PROJECT_DIR/$QT_TARGET.desktop
echo "[Desktop Entry]" > $DESKTOP
echo "Type=Application" >> $DESKTOP
echo "Name=$QT_TARGET_DISPLAY" >> $DESKTOP
echo "Exec=/opt/$QT_TARGET/bin/$QT_TARGET" >> $DESKTOP
echo "Icon=/usr/share/icons/hicolor/80x80/apps/${QT_TARGET}_80.png" >> $DESKTOP

